package com.xuxueli.commontdemo.util.testjinzhengclient;

import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

@Slf4j
public class ByteArrayEncoder extends MessageToMessageEncoder<byte[]> {

    @Override
    protected void encode(ChannelHandlerContext ctx, byte[] msg, List<Object> out) {
        log.info("发送数据：{}", HexUtils.toHexString(msg));
        out.add(Unpooled.wrappedBuffer(msg));
    }

}
